A block data transfer interface is frequently employed to expand the effective address space available to store data. A logical address within the address space of the central processing unit of the computing system is mapped by an address map of the block data transfer interface to a block of physical addresses of the memory which is often non-volatile or persistent memory.
In contrast to volatile memory, non-volatile memory can store data that persists even after the power is removed from the non-volatile memory. Examples of non-volatile or persistent memory include disk drives and solid state drives. However, if power is lost before completion of a data transfer to the memory, the data stored in a region may be a mixture of both newly transferred data and also old data which was not successfully updated with new data prior to the loss of power. Such a region containing both new data and old data which was not successfully updated is often referred to as a “torn” memory region.
To prevent read operations to such torn memory regions which can return corrupted data, the block data transfer interface may be configured to ensure “atomicity” of a data transfer in which either a data transfer is completed in its entirety, or if not, a partial data transfer is given no effect. Thus, if power fails at any time during a write operation to a region, atomicity can ensure that a subsequent read of that region will either return the old data intact if the write operation was not completed, or will return the new data if the write to the region had completed.
One approach to providing atomicity, is for the block transfer interface to write new update data to an unused area of the memory instead of to the original area containing the old data to be updated. If the data transfer to the new region is successfully completed, the block transfer interface updates the address map so that a logical address for the data is no longer mapped to physical addresses of the original region, but is instead re-mapped to the new region containing the updated data. Hence, a read operation addressed to the logical address is redirected to the new memory region containing the successfully updated data. A log which tracks available memory regions, often referred to as a free region log, may be updated to indicate that the original region is available to store other data.
Conversely, if the data transfer to the new region is not successfully completed due to a power failure, for example, upon return of power, the block transfer interface does not update the address map so that the logical address for the data continues to be mapped to physical addresses of the original region. Thus, the logical address is not re-mapped to the new region containing the partially updated data. Moreover, the free region log continues to indicate the original region as in use (occupied) and thus unavailable to store other data. Hence, a subsequent read operation addressed to the logical address can continue to be directed to the original memory region as if no portion of the incomplete data transfer took place.